1. Field of the Invention
The present invention relates to encoding image data according to a predetermined image encoding format. More particularly, this invention relates to image encoding apparatuses comprising more than one encoding unit, wherein the encoding units are configured to perform the encoding process in parallel.
2. Description of the Prior Art
It is known to provide an image encoding apparatus configured to encode image data according to a predetermined image encoding format. For example, it is known to provide an encoding apparatus which is configured to receive image data in a raw format (e.g. RGB or YUV) and to encode the image data according to a predetermined image encoding format such as those formats defined by the Joint Photographic Experts Group, commonly referred to generically as the JPEG format.
Image encoding formats such as JPEG can enable a significant reduction in the file size of image data without significant visible loss of image quality. Indeed, a data size reduction by a factor of 10 is commonly achievable without a loss of quality perceivable to the human eye.
The particular techniques involved in encoding image data according to image encoding formats such as JPEG are familiar to the person skilled in the art and are not described in detail herein. However, one particular aspect of the encoding process which is of relevance in the present context is the dependent encoding of a block of pixels within the image data with respect to a preceding block of pixels. For example, in the JPEG encoding format, the DC coefficient (average pixel value) of a block of pixels will commonly be defined with respect to the DC coefficient of the previous block of pixels. Because of the spatial correlation between blocks of pixels, i.e. a given block of pixels is likely to have similar pixel values to the preceding block of pixels, a data size reduction can be achieved when the difference to be encoded is relatively small.
It is also known to parallelize data processing tasks which comprise multiple sub-tasks. For example, several data processing units may be provided which are capable of performing those sub-tasks and the processing load of performing the data processing task is sub-divided between the multiple data processing units by allocating one or more sub-tasks to each of them. If the sub-tasks can be performed in parallel by the multiple data processing units, this parallelization of the data processing task can mean that the time required for it to be carried out can be greatly reduced by virtue of the multiple data processing units operating in parallel to one another.
However, the process of encoding image encoding formats such as JPEG, in which many blocks of image data within a given picture are encoded with respect to the block of image data which precedes them, is not easily adapted to such parallelization, since the encoding is by its nature sequential, each block in a chain of blocks requiring the previous block to be encoded in order to be encoded itself in dependence thereon.
Some aspects of the parallelization techniques which have previously been applied to JPEG encoding are discussed in “Scalability of a Parallel JPEG Encoder on Shared Memory Architectures”, D. Castells-Rufas et al., 2010 39th International. Conference on Parallel Processing. This paper reviews existing algorithmic approaches to the parallelization of the JPEG encoding process, in particular one in which the DCT transform process (inter alia) is parallelized followed by a combined, serial Huffmann encoding process. A technique is then described which seeks to parallelize the Huffmann encoding process. However, on the one hand this approach suffers from the disadvantage that a large quantity of intermediate data is generated by the first parallelized steps, which places significant demands on the system in terms of buffer capacity and memory bandwidth. Such demands are particularly undesirable in the context of systems with limited resources. On the other hand the technique described also suffers from inherent image degradation as can be seen in FIGS. 6 and 7 therein.
Accordingly, it would be desirable to provide an improved technique for encoding image data according to a predetermined image encoding format, wherein both the above described data size reduction advantages of block-to-block dependent encoding, and the above described advantages of data processing parallelization, could both be realised without generating undesirably large quantities of intermediate data and without a necessary image degradation.